home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
database
/
dg53.zip
/
DGOPS.SAM
< prev
next >
Wrap
Text File
|
1997-05-26
|
17KB
|
315 lines
-C Case sensitive (default is case insensitive).
-c Count only. Report the number of records
containing the search phrase.
-v inVert sense. Report records not containing
the search phrase.
-d$ Use $ or other following char as Delimiter
Exception: Use -dd (yes - lower case d repeated)
and the system will treat a blank line as the
delimiter for search (sort of like considering
paragraphs as records). Output will, however,
insert the standard "*" delimiter.
-dd Paragraph mode. Blank lines are record Delimiters.
True blank lines only- no spaces or tabs.
See -d above.
-k[n] Search in Keyword-lines-only. Declare the first n (1-9)
lines as keyword-lines. Default 1st line only.
-K[n] Limit output report to Keyword-lines-only.
The first n (1-9) lines are Keyword-lines.
Default 1st line only. n for -k and -K
options limited to 1 digit. They are
independent, and can be used together.
-s Status of data file: give record count only.
If used with -V option, reports misc. file data.
Ignores null records. (Reports them if verbose).
(overrides other options on the command line)
-l Treat aLL records as hits. No searchterm needed.
Useful with -D, -a, -A, -K options.
dg -Kpl will give an undelimited list of
first (key) lines. dg -Kplh# gives a similar
list of major/minor keylines for files with
major (*) records and sub(#)records.
Note- Other uses of -l and -h together are
not recommended.
-w Match only on Words. (phrase bound by spaces
or line boundary or any non-alpha, non-digit)
Underscore (_) is treated as part of a word.
-u Like -w but Underscore (_) is treated as a
word delimiter (as if whitespace) as well.
-x Search phrase is found even if it crosses over
a line boundary (X-over). One-line crossover
only. Ignores trailing but not leading
spaces on lines. Best when used with -T
to ignore leading spaces too. Note: trailing
hyphens are also ignored so that normal word
hyphenation is dealt with.
-f Get searchstrings from File.
Use filename to replace search phrase on the
command line. Leading and trailing spaces in
the file of phrases are stripped. For DOS, number of
searchstrings in the file is limited to 100
*and* a 20 character string size limit is imposed.
Finds are reported in the order they occur in the
data file, not the order of the file of terms.
(use batch files/unix scripts if you must extract
records in other than data file order.)
-F[n] The searchterm must be found in Field n of a
line to be considered a hit. Incompatible
with -mMxnUD and ^$ usage. A field of a line
is defined as in a default awk usage-- words or
terms separated by whitespace, with leading/trailing
whitespace ignored. Use -F with no numerics to
indicate the last field of a line regardless of
the number of fields there. See extended discussion
below.
-L Affects -F option. Lax enforcement of field numbers
and lengths. See extended discussion below.
-m[n] Expect n Multiple search terms on the command line,
each of which must be present on_a_single_line in a
record to cause a find. If n is omitted, n=2.
Incompatible with -v. Max n is 9. If the searchterms
are identical, 1 hit suffices. If used with -x,
finds must be within about 1 line of each other.
-M[n] Expect n Multiple search terms on the command line,
each of which must be present somewhere_in_the_record
to cause a find. If n is omitted, n=2.
Incompatible with -v. Max n is 9.
-E[n] Look for Extras-- expect 1 search term on the command
line, and report records having that term on at
least n separate lines. If n omitted, n=2.
Incompatible with -v. Looks for Extras.
-p Plain output. Do not print the delimiter on output.
Exception: with -y, kills only the sub-separator line.
-e Exact whole-line match required to cause a find.
-T Ignore L & R (lead/Trail) spaces on all lines.
Useful with -e or -x
-Q Quit on first find of term; on first find of *each* term
when used with -f. Useful with files that redundantly
repeat records, e.g. expanded procedural flows. If more
than one -f term is found in a record, all are satisfied
by printing that record. Do not confuse this with
-m or -M searches. The -Q option then will quit on the
first find satisfying the -m or -M condition.
-W Print only the record numbers where the finds occur.
("Which" records?)
-h$ Use $ or other following char as an added, secondary
"Helper" delimiter. The secondary delimiter will be
recognized whether in the first or second position
on a line. Output will be preceded by the first
line of the main record, and the phrase: "PARTIAL
RECORD:" Not compatible with -x option.
Exception: Use -hh or terminal -h with no character
specified, and the system will treat a virtual blank
line (true blank lines, or lines with only spaces/tabs)
as a secondary delimiter for search (sort of like
considering paragraphs as sub-records within explicitly
delimited records). Output will, however, insert the
standard "*" delimiter.
Example: dg -hhCF1 -h dgman
will give help on the -h option of dg.
-Dfname Divide(distribute) output:
Write records found to files fname0001, fname0002...
one file for each find. Supported ONLY as last option
in the option list. Limited to 9999 output files.
-n#[...] Get record by Number, e.g. -n456 = get 456th record
Compatible ONLY with -vKqod$... NOT with -aA
Null records are ignored when counting.
Supported ONLY as last option in the option list.
A syntax of -n#[#####],#[#####] is supported to retrieve
a range of record numbers. Particularly useful
when a large file must be divided.
-a Print whole data file, Append contents of zzapfile
to finds. See discussion below: UPDATING RECORD STATUS
-A Print whole data file, Append zzapfile line 1 to
keyline 1 of finds. See discussion below: UPDATING
RECORD STATUS
-j Affects -a, -A options- don't print whole
file, but Just the records with finds.
-J Affects -a, -A options- tacks a "Jumped" record
number onto "found" records.
-r Print the delimiter followed by dashes (like a
Ruler line) to enhance visual separation of records.
-R Retain content of original delimiter lines.
The default is to drop additional characters
following the delimiter. (The default permits
the delimiter line to contain "private"
file documentation.)
-B Fold-in Big data updates. Allows automated updates
of large record sets based on a file of update
directions. Highly useful but only in limited
circumstances. See discussion below.
-U Uniqify a set of records. Directs deletion of
repeated records based solely on the last field of
the first keyline. Limited filesizes except in
UNIX versions. See extended discussion below.
-V Verbose. Show prefatory/summary remarks. Use
with -s for datafile status report. Use -Vq with
dgw batch file to record filenames searched.
-H Emphasize the line in the record where the
search conditions were met. Prints markers
(happy faces if in DOS) at beginning of the
"Highlighted" line. Seldom needed, but can be
helpful when individual records are long.
-N Print a Negative message if no records are found.
Normally, there is no output when there are no
finds.
-o Null argument. Does nOthing. Useful from
some batch files/scripts.
-G A Grep-like option. Only the lines with the
match are printed. Use only if a real grep is
unavailable. No REGEXP, but usable with the
following options:
-w, -u, -c, -v, -T, -C, -e, -f, -m, -F, -N, ^$
Not usable with -k,-K,-x,-D,-Q,-y
nor with most other options that are record-oriented.
Inappropriate options are not all trapped, but
generally have no effect.
-y The grep-rest option. Unrelated to -G.
"digs" for a record, Yet greps it too.
Usable with -K such that IF a record is
a "hit" the -K keylines are printed, and
followed by any remaining lines in that record
that contain one of a set of other searchterms.
I.E.- print the keylines of finds and grep the
rest of the record for other searchterms.
The -m option and syntax must be used, but the
the FIRST term given in -m syntax becomes the
SOLE record searchterm and all OTHER -m terms
become what we grep for after the keylines.
Example:
dg -ykK2m3r gold melt boil elements
will print the 1st 2 keylines of records in the
file "elements" having "gold" in the 1st keyline,
and then print any remaining lines in the record
having the terms "melt" or "boil". Use with
the -r option for best visual separation of
resultant records.
-I Ignore delimiter if repeated in place 2.
i.e., if a line begins with ** then
Treat it as just a text line, not a delimiter line.
Useful with certain originals when you don't want
to clean them up first.
-S Add delimiters (Stars) to a file. A delimiter line is
added _before_ each line containing the search term.
Use -Sf and a file of searchterms when appropriate.
-P Add delimiters (Post-stars) to a file. Like -S,
but delimiters are added _following_ each line
that is a hit.
-q Quiet. No extraneous prefatory/summary remarks
(default, but retained for historical reasons).
Exception: Use -Vq with dgw batch file to record
filenames searched.
-i[n] Recognize an Indented delimiter anywhere in the first
n characters (1-9) of a line. Useful in delimiting
code files when the delimiter must reside inside
a comment, e.g.,
/* (c) , //* (c++) , #* (unix), ;* (lisp) , REM * (dos)
Especially useful with -T to kill leading whitespace
for files that have extensive indentation schemes.
Thus a -Ti option allows #* to work with any amount
of leading whitespace.
-Z[Z][1] FuZzy searches-- Look for approximate matches.
The -Z option uses a SOUNDEX algorithm that assumes
the first letter of every word is unfuzzy. Use
the -ZZ option to fuzz even the first letter,
e.g., batter with a searchterm of "patter", but
expect lots of false hits. A Z1 option uses a stem
algorithm that might find "silliness" when you
search for "silly". All three fuzzy approaches
are desperation moves, sometimes laughable.
You may need the -H option to figure out which
line caused the hit. Expect "fuzzy" to be more
like "hairy" or even "wooly" most of the time.
The SOUNDEX approach is an old classic, which gives
decent results when you must search with names or
commonly misspelled words such as nuclear and
personnel, but expect lots of extra drivel as well.
Only the first few syllables are checked. If you're
curious, you can inspect the kind of coding produced
for any searchterm by adding a -N option using a
file you know will NOT produce a match. The "not
found" report will show the soundex or stem code of
the searchterm. Alternatively, add a -V verbose
option and wade through the whole mess.
Expect junk results if you use small searchterms,
numeric searchterms, or searchterms that include
spaces or punctuation. The -w option is disallowed.
Although only words are really treated, there can be
no guarantee of a true wordmatch. The -e option is
allowed, but a hit indicates exactness only in the
coding string, not in the actual text. All fuzzy
searches are automatically case-insensitive.
-O Show PrOgress-- when working very large files,
print some sign of life every 1000 lines
to screen only.
^$ These are not command line options, but implied
options nonetheless. Though full unix regular
expressions are not supported, the ^ and $
expressions are:
dg ^foo filename
means look for "foo" at the beginning of a line.
Similarly:
foo$ means foo at the end of a line
\^foo means search for literal "^foo"
foo\$ means search for literal "foo$"
Note that a search for ^RAT$ is designed to
succeed on "RATCELLAR WITH RAT"
Use -e for the unix sense of ^RAT$
where the intent is SOL-phrase-EOL.